Jump to content

- Appendix B

- # Jira Service Integration - B.1 - Access/modify the code behind

  Followers 0

  How to make your own modifications or simply just take a look onto the implementation to get an idea of how everything works?

  The following explanations will refer to the VBScript version, the Lua version however is more or less identical in its structure.

  The entire code of this integration is located in one single file, JiraServiceIntegration.vbs.

  All functionality is encapsulated in a class (JiraServiceClass), which defines properties for all parameters (with some validation) as also private and public methods.

  To make use of the JiraServiceClass class the JiraServiceIntegration.vbs file must be included first. This is done in the "Start" block of the GSE Action or your own GSE rule.

      '#inlcude "JiraServiceIntegration.vbs"

  Afterwards the class needs to get instantiated, its properties set and the needed public method/function called. The return value of the function is either "0" (ok) or "1" (failed), so it can be used directly for the exits of a "Insert Script Code" or "Run GSE Action" block.

  And this is exactly what the GSE actions of this project are doing.

  In order to make modifications it is not simply possible to modify the JiraServiceIntegration.vbs file and re-upload it again into the SwyxWare database. This is because the file is digitally signed, which is necessary to get it included with the #include statement.

  The easiest way to do your own modifications is to forget about the JiraServiceIntegration.vbs file all together and use just its content within a start block of a GSE rule (instead of the #include statement), but without the digital signature.

  You can strip the signature yourself from the code (first line and all lines from the bottom), or simply use the content of the start.vbs file from the "vbs" folder or the download package.

      VBScript based\vbs\start.vbs

  So just do all your modifications within the start.vbs file and afterwards just copy & paste the entire content of the file into the "Start" block

  and then use the Insert "Insert Script Code" block to instantiate the IPS class and call its functionality

      Dim c
      Set c = new JiraServiceClass
      with c
        .sBaseURL         = "https://my-service.atlassian.net"
        .sLoginUser       = "[email protected]"
        .sLoginToken      = "1234567890"
        .sProjectKey      = "SUP"
        .sSummary         = "My first issue via Jira REST API"
        .sDescription     = "Hello world"
        .sIssueType       = "Support"
        sReturn           = .CreateIssue
      end with
      Set c = Nothing

  It is highly recommended to not do any code modifications directly in the Start block, but instead use a proper editor like VS Code or Notepad++.

  You are now free to to any modifications within the code and use it afterwards in your own GSE rules.

  If you want to update the JiraServiceIntegration.vbs in the end, you need to update its signature as well. This can be done with the "SignScript" tool which can be found in the Enreach Partner Net (you need a partner login).

  In order to get get your own .vbs file signed, make sure that the text encoding is UTF-8-BOM. This can easily be checked/configured with Notepad++.

  Please feel free to ask any questions regarding the code, implementation or distribution (signing, including, etc.) in the Open ECR Extensions forum.

  Most of the above mentioned is also true for the following extensions. So there is lots more to explore

  - Invision Power Services (IPS) Integration (REST API usage, API Key/Token authentication)
  - Longest Waiting (Database usage)
  - Open Queue (Database usage)
  - Zendesk Integration (REST API usage, API Key/Token authentication)

  By Tom Wellige

  - September 3, 2024
  Share
  Share
  Followers 0
  Next Page B.2 - Version History

## Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.